package design_pattern.ActiveObjects;

/**
 * @Author: 蔡翔
 * @Date: 2019/11/27 15:09
 * @Version 1.0
 *
 * 把ActiveObject 的每一个方法转化为对象。
 */
/**
 * {@link ActiveObject#makeString(int, char)}
 **/
public class MakeStringRequest extends MethodRequest {

    private final int count;
    private final char fillChar;

    public MakeStringRequest(Servant servant, FutureResult futureResult,int count,char fillChar) {
        super(servant, futureResult);
        this.count = count;
        this.fillChar = fillChar;
    }

    @Override
    public void execute() {
        Result result = servant.makeString(count,fillChar);
        futureResult.setResult(result);
    }
}
